/* Gyroe 1.0.0 */
/* main.c : Starts up the interpreter, setting values for most
   of the important variables. Also processes opening the first file
   sent to the interpreter. */

#include <stddef.h>
#include <time.h>
#include "euphoria.h"
#include "main-.h"
#include <unistd.h>

int Argc;
char **Argv;
unsigned char *poke_addr;
unsigned long *peek4_addr;
unsigned long *poke4_addr;
struct d temp_d;
double temp_dbl;
char *stack_base;
int total_stack_size = 262144;

int entry;
object_ptr e_base;
int e_arg1, e_arg2, e_arg3, e_arg4, e_arg5;
int e_return;

object new_key_entry()
/* Generate a new entry for the keylist. */
{
    entry = NewS1(5);
    e_base = ((s1_ptr)entry)->base;
    e_base[1] = e_arg1;
    e_base[2] = e_arg2;
    e_base[3] = e_arg3;
    e_base[4] = e_arg4;
    e_base[5] = e_arg5;
    e_return = MAKE_SEQ(entry);
    return e_return;
}

object new_lex_entry(int var, int vstr)
/* Make an entry to the lexname list. */
{
    entry = NewS1(2);
    e_base = ((s1_ptr)entry)->base;
    e_base[1] = var;
    e_base[2] = vstr;
    e_return = MAKE_SEQ(entry);
    return e_return;
}

int main(int argc, char *argv[])
/* Initialize the main stuff. Will be cleaned up later. */
{
    int _735;
    int _0, _1, _2;

    Argc = argc;
    Argv = argv;
    stack_base = (char *)&_0;
    eu_startup(_00, (int)CLOCKS_PER_SEC, (int)sysconf(_SC_CLK_TCK));
    init_literal(); /* Sets up all the stuff in init-.c */
    shift_args(argc, argv);
    _4ELINUX = (3 == 3);
    _4EWINDOWS = (3 == 2);
    _4EDOS = (3 == 1);

#ifdef ELINUX
    _4PATH_SEPARATOR = 58; /* : */
    _4SLASH = 47; /* / */
    _4SLASH_CHARS = _274;
    /* Special chars allowed in path. */
#else
    _4PATH_SEPARATOR = 59; /* ; */
    _4SLASH = 92; /* \ */
    _4SLASH_CHARS = _277; /* \ and / and : */
#endif

    _4NOVALUE = _321;
    /* For showing that the item has no value. Always on, except for constants. */

    _4SymTab = _39;
    /* The Symbol Table where almost everything is stored. */

    _4file_name = _39;
    _4file_name_entered = _39;
    _4current_file_no = 1;
    _4slist = _39;

    _6warning_list = _39;
    /* Error list. */

    _10buckets = Repeat(0, 2003);
    /* For calculating hashes. */

    _10literal_init = 0;

    RefDS(_39);
    _10lastintval = _39;
    /* Integers : The values of the integers sent. */

    RefDS(_39);
    _10lastintsym = _39;
    /* Integers : Holds the position of the value. */

    /* When integers are made, lastinval and lastintsym are checked to see if we already
       have a symbol with that value. If so, we point to it instead of making a new one. */

    _10last_sym = 0;

    _10SEARCH_LIMIT = 20;
    /* How long to search for a double before stopping. */

    _10temps_allocated = 0;
    /* A counter of how many temps were allocated. Used to allocate the stack for tasks. */

    _11start_include = 0;
    _11LastLineNumber = -1;

    RefDS(_39);
    _11all_source = _39; /* Storage spot for trace. */

    _11current_source_next = 10000; /* For Scanner.c : Helps allocate for trace. */
    _14previous_op = -1; /* For emit.c : Holds the last op we emitted. */

    RefDS(_39);
    _14current_sequence = _39; /* The current sequence we are working with. */

    _14lhs_ptr = 0;
    _14assignable = 0; /* For emit.c : Is this routine/op assignable to? */

    _15sample_size = 0;
    /* For profiling. */

    _15max_stack_per_call = 1;
    /* Not necessary, since it's always 1. However, backend references it, so i'll
       remove it when I get to backend.c */

    RefDS(_39);
    DeRef(_15branch_list);
    _15branch_list = _39;

    _15short_circuit = 0;
    _15short_circuit_B = 0; /* circuit expression? given short_circuit_B is 1 (TRUE) */
    _15factors = 0;
    _15lhs_subs_level = -1;
    _15left_sym = 0;

    RefDS(_3832);
    DeRef(_15mix_msg);
    _15mix_msg = _3832;

    /* For compressing objects in backend. */
    _16MIN2B = - 32768;
    _16MAX2B = 32767;
    _16MIN3B = - 8388608;
    _16MAX3B = 8388607;
    _735 = power(2, 31);
    _16MIN4B = unary_op(UMINUS, _735);
    DeRef(_735);

    int ptr_;
    s1_ptr ptr;
    object_ptr Base;

    /* Fields for keylist... */
    _1 = NewS1(98);
    _2 = (int)((s1_ptr)_1)->base;
    Base = ((s1_ptr)_1)->base;

    /* Set the elements of the keylist. This will be used later to make SymTab. */

    e_arg1 = NewString("if");
    e_arg2 = 8; e_arg3 = 20; e_arg4 = 0; e_arg5 = 0;
    Base[1] = new_key_entry();
    /* "if", SC_KEYWORD, IF, 0, 0 */

    e_arg1 = NewString("end");
    e_arg3 = 402;
    Base[2] = new_key_entry();
    /* "end", SC_KEYWORD, END, 0, 0 */

    e_arg1 = NewString("then");
    e_arg3 = 409;
    Base[3] = new_key_entry();
    /* "then", SC_KEYWORD, THEN, 0, 0 */

    e_arg1 = NewString("procedure");
    e_arg3 = 405;
    Base[4] = new_key_entry();
    /* "procedure", SC_KEYWORD, PROCEDURE, 0, 0 */

    e_arg1 = NewString("else");
    e_arg3 = 23;
    Base[5] = new_key_entry();
    /* "else", SC_KEYWORD, ELSE, 0, 0 */

    e_arg1 = NewString("for");
    e_arg3 = 21;
    Base[6] = new_key_entry();
    /* "for", SC_KEYWORD, FOR, 0, O */

    e_arg1 = NewString("return");
    e_arg3 = 412;
    Base[7] = new_key_entry();
    /* "return", SC_KEYWORD, RETURN, 0, 0 */

    e_arg1 = NewString("do");
    e_arg3 = 410;
    Base[8] = new_key_entry();
    /* "do", SC_KEYWORD, DO, 0, 0 */

    e_arg1 = NewString("elsif");
    e_arg3 = 413;
    Base[9] = new_key_entry();
    /* "elsif", SC_KEYWORD, ELSIF, 0, 0 */

    e_arg1 = NewString("while");
    e_arg3 = 47;
    Base[10] = new_key_entry();
    /* "while", SC_KEYWORD, WHILE, 0, 0 */

    e_arg1 = NewString("type");
    e_arg3 = 415;
    Base[11] = new_key_entry();
    /* "type", SC_KEYWORD, TYPE_DECL, 0, 0 */

    e_arg1 = NewString("constant");
    e_arg3 = 416;
    Base[12] = new_key_entry();
    /* "constant", SC_KEYWORD, CONSTANT, 0, 0 */

    e_arg1 = NewString("to");
    e_arg3 = 403;
    Base[13] = new_key_entry();
    /* "to", SC_KEYWORD, TO, 0, 0 */

    e_arg1 = NewString("and");
    e_arg3 = 8;
    Base[14] = new_key_entry();
    /* "and", SC_KEYWORD, AND, 0, 0 */

    e_arg1 = NewString("or");
    e_arg3 = 9;
    Base[15] = new_key_entry();
    /* "or", SC_KEYWORD, OR, 0, 0 */

    e_arg1 = NewString("exit");
    e_arg3 = 61;
    Base[16] = new_key_entry();
    /* "exit", SC_KEYWORD, EXIT, 0, 0 */

    e_arg1 = NewString("function");
    e_arg3 = 406;
    Base[17] = new_key_entry();
    /* "function", SC_KEYWORD, FUNCTION, 0, 0 */

    e_arg1 = NewString("global");
    e_arg3 = 411;
    Base[18] = new_key_entry();
    /* "global", SC_KEYWORD, GLOBAL, 0, 0 */

    e_arg1 = NewString("by");
    e_arg3 = 404;
    Base[19] = new_key_entry();
    /* "by", SC_KEYWORD, BY, 0, 0 */

    e_arg1 = NewString("not");
    e_arg3 = 7;
    Base[20] = new_key_entry();
    /* "not", SC_KEYWORD, NOT, 0, 0 */

    e_arg1 = NewString("include");
    e_arg3 = 417;
    Base[21] = new_key_entry();
    /* "include", SC_KEYWORD, INCLUDE, 0, 0 */

    e_arg1 = NewString("with");
    e_arg3 = 419;
    Base[22] = new_key_entry();
    /* "with", SC_KEYWORD, WITH, 0, 0 */

    e_arg1 = NewString("without");
    e_arg3 = 420;
    Base[23] = new_key_entry();
    /* "without", SC_KEYWORD, WITHOUT, 0, 0 */

    e_arg1 = NewString("xor");
    e_arg3 = 154;
    Base[24] = new_key_entry();
    /* "xor", SC_KEYWORD, XOR, 0, 0 */

    /* Now the ops... */

    e_arg1 = NewString("length");
    e_arg2 = 7; e_arg3 = 501; e_arg4 = 42; e_arg5 = 1;
    Base[25] = new_key_entry();
    /* "length", SC_PREDEF, FUNC, LENGTH, 1 */

    e_arg1 = NewString("puts");
    e_arg3 = 27; e_arg4 = 44; e_arg5 = 2;
    Base[26] = new_key_entry();
    /* "puts", SC_PREDEF, PROC, PUTS, 2 */

    e_arg1 = NewString("integer");
    e_arg3 = 504; e_arg4 = 94; e_arg5 = 1;
    Base[27] = new_key_entry();
    /* "integer", SC_PREDEF, TYPE, IS_AN_INTEGER, 1 */

    e_arg1 = NewString("sequence");
    e_arg4 = 68;
    Base[28] = new_key_entry();
    /* "sequence", SC_PREDEF, TYPE, IS_A_SEQUENCE, 1 */

    e_arg1 = NewString("position");
    e_arg3 = 27; e_arg4 = 60; e_arg5 = 2;
    Base[29] = new_key_entry();
    /* "position", SC_PREDEF, PROC, POSITION, 2 */

    e_arg1 = NewString("object");
    e_arg3 = 504; e_arg4 = 40; e_arg5 = 1;
    Base[30] = new_key_entry();
    /* "object", SC_PREDEF, FUNC, IS_AN_OBJECT, 1 */

    e_arg1 = NewString("append");
    e_arg3 = 501; e_arg4 = 35; e_arg5 = 2;
    Base[31] = new_key_entry();
    /* "append", SC_PREDEF, FUNC, APPEND, 2 */

    e_arg1 = NewString("prepend");
    e_arg4 = 57;
    Base[32] = new_key_entry();
    /* "prepend", SC_PREDEF, FUNC, PREPEND, 2 */

    e_arg1 = NewString("print");
    e_arg3 = 27; e_arg4 = 19;
    Base[33] = new_key_entry();
    /* "print", SC_PREDEF, PROC, PRINT, 2 */

    e_arg1 = NewString("printf");
    e_arg4 = 38; e_arg5 = 3;
    Base[34] = new_key_entry();
    /* "printf", SC_PREDEF, PROC, PRINTF, 3 */

    e_arg1 = NewString("clear_screen");
    e_arg4 = 59; e_arg5 = 0;
    Base[35] = new_key_entry();
    /* "clear_screen", SC_PREDEF, PROC, CLEAR_SCREEN, 0 */

    e_arg1 = NewString("floor");
    e_arg3 = 501; e_arg4 = 83; e_arg5 = 1;
    Base[36] = new_key_entry();
    /* "floor", SC_PREDEF, FUNC, FLOOR, 1 */

    e_arg1 = NewString("getc");
    e_arg4 = 33;
    Base[37] = new_key_entry();
    /* "getc", SC_PREDEF, FUNC, GETC, 1 */

    e_arg1 = NewString("gets");
    e_arg3 = 501; e_arg4 = 17; e_arg5 = 1;
    Base[38] = new_key_entry();
    /* "gets", SC_PREDEF, FUNC, GETS, 1 */

    e_arg1 = NewString("get_key");
    e_arg4 = 79; e_arg5 = 0;
    Base[39] = new_key_entry();
    /* "get_key", SC_PREDEF, FUNC, GET_KEY, 0 */

    e_arg1 = NewString("rand");
    e_arg4 = 62; e_arg5 = 1;
    Base[40] = new_key_entry();
    /* "rand", SC_PREDEF, FUNC, RAND, 1 */

    e_arg1 = NewString("repeat");
    e_arg4 = 32; e_arg5 = 2;
    Base[41] = new_key_entry();
    /* "repeat", SC_PREDEF, FUNC, REPEAT, 2 */

    e_arg1 = NewString("atom");
    e_arg3 = 504; e_arg4 = 67; e_arg5 = 1;
    Base[42] = new_key_entry();
    /* "atom", SC_PREDEF, TYPE, IS_AN_ATOM, 1 */

    e_arg1 = NewString("compare");
    e_arg3 = 501; e_arg4 = 76; e_arg5 = 2;
    Base[43] = new_key_entry();
    /* "compare", SC_PREDEF, FUNC, COMPARE, 2 */

    e_arg1 = NewString("find");
    e_arg4 = 77;
    Base[44] = new_key_entry();
    /* "find", SC_PREDEF, FUNC, FIND, 2 */

    e_arg1 = NewString("match");
    e_arg4 = 78;
    Base[45] = new_key_entry();
    /* "match", SC_PREDEF, FUNC, MATCH, 2 */

    e_arg1 = NewString("time");
    e_arg4 = 70; e_arg5 = 0;
    Base[46] = new_key_entry();
    /* "time", SC_PREDEF, FUNC, TIME, 0 */

    e_arg1 = NewString("command_line");
    e_arg4 = 100;
    Base[47] = new_key_entry();
    /* "command_line", SC_PREDEF, FUNC, COMMAND_LINE, 0 */

    e_arg1 = NewString("open");
    e_arg4 = 37; e_arg5 = 2;
    Base[48] = new_key_entry();
    /* "open", SC_PREDEF, FUNC, OPEN, 2 */

    e_arg1 = NewString("close");
    e_arg3 = 27; e_arg4 = 86; e_arg5 = 1;
    Base[49] = new_key_entry();
    /* "close", SC_PREDEF, PROC, CLOSE, 1 */

    e_arg1 = NewString("trace");
    e_arg4 = 64; e_arg5 = 1;
    Base[50] = new_key_entry();
    /* "trace", SC_PREDEF, PROC, TRACE, 1 */

    e_arg1 = NewString("getenv");
    e_arg3 = 501; e_arg4 = 91;
    Base[51] = new_key_entry();
    /* "getenv", SC_PREDEF, FUNC, GETENV, 1 */

    e_arg1 = NewString("sqrt");
    e_arg4 = 41;
    Base[52] = new_key_entry();
    /* "sqrt", SC_PREDEF, FUNC, SQRT, 1 */

    e_arg1 = NewString("sin");
    e_arg4 = 80;
    Base[53] = new_key_entry();
    /* "sin", SC_PREDEF, FUNC, SIN, 1 */

    e_arg1 = NewString("cos");
    e_arg4 = 81;
    Base[54] = new_key_entry();
    /* "cos", SC_PREDEF, FUNC, COS, 1 */

    e_arg1 = NewString("tan");
    e_arg4 = 82;
    Base[55] = new_key_entry();
    /* "tan", SC_PREDEF, FUNC, TAN, 1 */

    e_arg1 = NewString("log");
    e_arg4 = 74;
    Base[56] = new_key_entry();
    /* "log", SC_PREDEF, FUNC, LOG, 1 */

    e_arg1 = NewString("system");
    e_arg3 = 27; e_arg4 = 99; e_arg5 = 2;
    Base[57] = new_key_entry();
    /* "system", SC_PREDEF, PROC, SYSTEM, 2 */

    e_arg1 = NewString("date");
    e_arg3 = 501; e_arg4 = 69; e_arg5 = 0;
    Base[58] = new_key_entry();
    /* "date", SC_PREDEF, FUNC, DATE, 0 */

    e_arg1 = NewString("remainder");
    e_arg4 = 71; e_arg5 = 2;
    Base[59] = new_key_entry();
    /* "remainder", SC_PREDEF, FUNC, REMAINDER, 2 */

    e_arg1 = NewString("power");
    e_arg4 = 72;
    Base[60] = new_key_entry();
    /* "power", SC_PREDEF, FUNC, POWER, 2 */

    e_arg1 = NewString("machine_func");
    e_arg4 = 111;
    Base[61] = new_key_entry();
    /* "machine_func", SC_PREDEF, FUNC, MACHINE_FUNC, 2 */

    e_arg1 = NewString("machine_proc");
    e_arg3 = 27; e_arg4 = 112;
    Base[62] = new_key_entry();
    /* "machine_proc", SC_PREDEF, PROC, MACHINE_PROC, 2 */

    e_arg1 = NewString("abort");
    e_arg4 = 126; e_arg5 = 1;
    Base[63] = new_key_entry();
    /* "abort", SC_PREDEF, PROC, ABORT, 1 */

    e_arg1 = NewString("peek");
    e_arg3 = 501; e_arg4 = 127;
    Base[64] = new_key_entry();
    /* "peek", SC_PREDEF, FUNC, PEEK, 1 */

    e_arg1 = NewString("poke");
    e_arg3 = 27; e_arg4 = 128; e_arg5 = 2;
    Base[65] = new_key_entry();
    /* "poke", SC_PREDEF, PROC, POKE, 2 */

    e_arg1 = NewString("call");
    e_arg3 = 27; e_arg4 = 129; e_arg5 = 1;
    Base[66] = new_key_entry();
    /* "call", SC_PREDEF, PROC, CALL, 1 */

    e_arg1 = NewString("sprintf");
    e_arg3 = 501; e_arg4 = 53; e_arg5 = 2;
    Base[67] = new_key_entry();
    /* "sprintf", SC_PREDEF, FUNC, SPRINTF, 2 */

    e_arg1 = NewString("arctan");
    e_arg4 = 73; e_arg5 = 1;
    Base[68] = new_key_entry();
    /* "arctan", SC_PREDEF, FUNC, ARCTAN, 1 */

    e_arg1 = NewString("and_bits");
    e_arg4 = 56; e_arg5 = 2;
    Base[69] = new_key_entry();
    /* "and_bits", SC_PREDEF, FUNC, AND_BITS, 2 */

    e_arg1 = NewString("or_bits");
    e_arg4 = 24; e_arg5 = 2;
    Base[70] = new_key_entry();
    /* "or_bits", SC_PREDEF, FUNC, OR_BITS, 2 */

    e_arg1 = NewString("xor_bits");
    e_arg4 = 26;
    Base[71] = new_key_entry();
    /* "xor_bits", SC_PREDEF, FUNC, XOR_BITS, 2 */

    e_arg1 = NewString("not_bits");
    e_arg4 = 51; e_arg5 = 1;
    Base[72] = new_key_entry();
    /* "not_bits", SC_PREDEF, FUNC, NOT_BITS, 1 */

    e_arg1 = NewString("pixel");
    e_arg3 = 27; e_arg4 = 130; e_arg5 = 2;
    Base[73] = new_key_entry();
    /* "pixel", SC_PREDEF, PROC, PIXEL, 2 */

    e_arg1 = NewString("get_pixel");
    e_arg3 = 501; e_arg4 = 131; e_arg5 = 1;
    Base[74] = new_key_entry();
    /* "get_pixel", SC_PREDEF, FUNC, GET_PIXEL, 1 */

    e_arg1 = NewString("mem_copy");
    e_arg3 = 27; e_arg4 = 132; e_arg5 = 3;
    Base[75] = new_key_entry();
    /* "mem_copy", SC_PREDEF, PROC, MEM_COPY, 3 */

    e_arg1 = NewString("mem_set");
    e_arg4 = 133; e_arg5 = 3;
    Base[76] = new_key_entry();
    /* "mem_set", SC_PREDEF, PROC, MEM_SET, 3 */

    e_arg1 = NewString("c_proc");
    e_arg4 = 134; e_arg5 = 2;
    Base[77] = new_key_entry();
    /* "c_proc", SC_PREDEF, PROC, C_PROC, 2 */

    e_arg1 = NewString("c_func");
    e_arg3 = 501; e_arg4 = 135;
    Base[78] = new_key_entry();
    /* "c_func", SC_PREDEF, FUNC, C_FUNC, 2 */

    e_arg1 = NewString("routine_id");
    e_arg4 = 136; e_arg5 = 1;
    Base[79] = new_key_entry();
    /* "routine_id", SC_PREDEF, FUNC, ROUTINE_ID, 1 */

    e_arg1 = NewString("call_proc");
    e_arg3 = 27; e_arg4 = 138; e_arg5 = 2;
    Base[80] = new_key_entry();
    /* "call_proc", SC_PREDEF, PROC, CALL_PROC, 2 */

    e_arg1 = NewString("call_func");
    e_arg3 = 501; e_arg4 = 139;
    Base[81] = new_key_entry();
    /* "call_func", SC_PREDEF, FUNC, CALL_FUNC, 2 */

    e_arg1 = NewString("poke4");
    e_arg3 = 27; e_arg4 = 140;
    Base[82] = new_key_entry();
    /* "poke4", SC_PREDEF, PROC, POKE4, 2 */

    e_arg1 = NewString("peek4s");
    e_arg3 = 501; e_arg4 = 141; e_arg5 = 1;
    Base[83] = new_key_entry();
    /* "peek4s", SC_PREDEF, FUNC, PEEK4S, 1 */

    e_arg1 = NewString("peek4u");
    e_arg4 = 142;
    Base[84] = new_key_entry();
    /* "peek4u", SC_PREDEF, FUNC, PEEK4U, 1 */

    e_arg1 = NewString("profile");
    e_arg3 = 27; e_arg4 = 153;
    Base[85] = new_key_entry();
    /* "profile", SC_PREDEF, PROC, PROFILE, 1 */

    e_arg1 = NewString("equal");
    e_arg3 = 501; e_arg4 = 155; e_arg5 = 2;
    Base[86] = new_key_entry();
    /* "equal", SC_PREDEF, FUNC, EQUAL, 2 */

    e_arg1 = NewString("system_exec");
    e_arg4 = 156;
    Base[87] = new_key_entry();
    /* "system_exec", SC_PREDEF, FUNC, SYSTEM_EXEC, 2 */

    e_arg1 = NewString("platform");
    e_arg4 = 157; e_arg5 = 0;
    Base[88] = new_key_entry();
    /* "platform", SC_PREDEF, FUNC, PLATFORM, 0 */

    e_arg1 = NewString("task_create");
    e_arg4 = 169; e_arg5 = 2;
    Base[89] = new_key_entry();
    /* "task_create", SC_PREDEF, FUNC, TASK_CREATE, 2 */

    e_arg1 = NewString("task_schedule");
    e_arg3 = 27; e_arg4 = 170;
    Base[90] = new_key_entry();
    /* "task_schedule", SC_PREDEF, PROC, TASK_SCHEDULE, 2 */

    e_arg1 = NewString("task_yield");
    e_arg4 = 171; e_arg5 = 0;
    Base[91] = new_key_entry();
    /* "task_yield", SC_PREDEF, PROC, TASK_YIELD, 0 */

    e_arg1 = NewString("task_self");
    e_arg3 = 501; e_arg4 = 172;
    Base[92] = new_key_entry();
    /* "task_self", SC_PREDEF, FUNC, TASK_SELF, 0 */

    e_arg1 = NewString("task_suspend");
    e_arg3 = 27; e_arg4 = 173; e_arg5 = 1;
    Base[93] = new_key_entry();
    /* "task_suspend", SC_PREDEF, PROC, TASK_SUSPEND, 1 */

    e_arg1 = NewString("task_list");
    e_arg3 = 501; e_arg4 = 174; e_arg5 = 0;
    Base[94] = new_key_entry();
    /* "task_list", SC_PREDEF, FUNC, TASK_LIST, 0 */

    e_arg1 = NewString("task_status");
    e_arg4 = 157; e_arg5 = 1;
    Base[95] = new_key_entry();
    /* "task_status", SC_PREDEF, FUNC, TASK_STATUS, 1 */

    e_arg1 = NewString("task_clock_stop");
    e_arg3 = 27; e_arg4 = 176; e_arg5 = 0;
    Base[96] = new_key_entry();
    /* "task_clock_stop", SC_PREDEF, PROC, TASK_CLOCK_STOP, 0 */

    e_arg1 = NewString("task_clock_start");
    e_arg4 = 177;
    Base[97] = new_key_entry();
    /* "task_clock_start", SC_PREDEF, PROC, TASK_CLOCK_START, 0 */

    e_arg1 = NewString("_toplevel_");
    e_arg4 = 0;
    Base[98] = new_key_entry();
    /* "_toplevel_", SC_PREDEF, PROC, 0, 0 */

    /* _toplevel_ is an extremely important part of SymTab. When we pass off
       SymTab through the backend, this is then executed as if it were a proc.
       This contains all code not in functions or procedures. A user cannot call
       this directly because _ isn't allowed to start routines, I think. */

    _8keylist = MAKE_SEQ(_1);

    /* Generating fields for token_name now. token_name is used by LexName to get
       a correct message from a token. This way, instead of sending strings to be matched,
       we send numbers from scanner. If the number we send doesn't match scanner's, then
       we search through this list to find a name for the token to tell the user what was
       expected and what we got. If we're unable to find the token, we return '...'.
       In the future, this may only be used to output "expected %s", which would mean less
       tokens to hold. Also, less redundancy by telling the user what they sent with the line
       holding the stuff they sent too! */

    _1 = NewS1(59);
    _2 = (int)((s1_ptr)_1)->base;
    Base = ((s1_ptr)_1)->base;
    Base[1] = new_lex_entry(8, NewString("and"));
    Base[2] = new_lex_entry(502, NewString("a number"));
    Base[3] = new_lex_entry(-1, NewString("!"));
    Base[4] = new_lex_entry(404, NewString("by"));
    Base[5] = new_lex_entry(-23, NewString(":"));
    Base[6] = new_lex_entry(-30, NewString(","));
    Base[7] = new_lex_entry(15, NewString("&"));
    Base[8] = new_lex_entry(416, NewString("constant"));
    Base[9] = new_lex_entry(14, NewString("/"));
    Base[10] = new_lex_entry(410, NewString("do"));
    Base[11] = new_lex_entry(23, NewString("else"));
    Base[12] = new_lex_entry(413, NewString("elsif"));
    Base[13] = new_lex_entry(402, NewString("end"));
    Base[14] = new_lex_entry(-21, NewString("the end of file."));
    Base[15] = new_lex_entry(155, NewString("="));
    Base[16] = new_lex_entry(61, NewString("exit"));
    Base[17] = new_lex_entry(21, NewString("for"));
    Base[18] = new_lex_entry(501, NewString("a function"));
    Base[19] = new_lex_entry(406, NewString("function"));
    Base[20] = new_lex_entry(411, NewString("global"));
    Base[21] = new_lex_entry(6, NewString(">"));
    Base[22] = new_lex_entry(2, NewString(">="));
    Base[23] = new_lex_entry(20, NewString("if"));
    Base[24] = new_lex_entry(-20, NewString("an illegal character"));
    Base[25] = new_lex_entry(417, NewString("include"));
    Base[26] = new_lex_entry(-24, NewString("{"));
    Base[27] = new_lex_entry(-26, NewString("("));
    Base[28] = new_lex_entry(-28, NewString("["));
    Base[29] = new_lex_entry(1, NewString("<"));
    Base[30] = new_lex_entry(5, NewString("<="));
    Base[31] = new_lex_entry(10, NewString("-"));
    Base[32] = new_lex_entry(13, NewString("*"));
    Base[33] = new_lex_entry(523, NewString("a namespace qualifier"));
    Base[34] = new_lex_entry(-6, NewString("end-of-line"));
    Base[35] = new_lex_entry(7, NewString("not"));
    Base[36] = new_lex_entry(4, NewString("!="));
    Base[37] = new_lex_entry(9, NewString("or"));
    Base[38] = new_lex_entry(11, NewString("+"));
    Base[39] = new_lex_entry(27, NewString("a procedure"));
    Base[40] = new_lex_entry(405, NewString("procedure"));
    Base[41] = new_lex_entry(515, NewString("a variable"));
    Base[42] = new_lex_entry(524, NewString("a function"));
    Base[43] = new_lex_entry(525, NewString("a procedure"));
    Base[44] = new_lex_entry(526, NewString("a type"));
    Base[45] = new_lex_entry(-25, NewString("}"));
    Base[46] = new_lex_entry(-27, NewString(")"));
    Base[47] = new_lex_entry(-29, NewString("]"));
    Base[48] = new_lex_entry(412, NewString("return"));
    Base[49] = new_lex_entry(516, NewString("a slice"));
    Base[50] = new_lex_entry(503, NewString("a character string"));
    Base[51] = new_lex_entry(403, NewString("to"));
    Base[52] = new_lex_entry(409, NewString("then"));
    Base[53] = new_lex_entry(504, NewString("a type"));
    Base[54] = new_lex_entry(415, NewString("type"));
    Base[55] = new_lex_entry(-100, NewString("a variable"));
    Base[56] = new_lex_entry(419, NewString("with"));
    Base[57] = new_lex_entry(420, NewString("without"));
    Base[58] = new_lex_entry(47, NewString("while"));
    Base[59] = new_lex_entry(63, NewString("?"));

    _14token_name = MAKE_SEQ(_1);

    /* op_result = repeat(T_UNKNOWN, MAX_OPCODE) */
    _14op_result = Repeat(5, 177);

    ptr = SEQ_PTR(_14op_result);
    Base = ptr->base;

    /* op_result[RIGHT_BRACE_N] = T_SEQUENCE */
    Base[31] = 3;

    /* op_result[RIGHT_BRACE_2] = T_SEQUENCE */
    Base[85] = 3;

    /* op_result[REPEAT] = T_SEQUENCE */
    Base[32] = 3;

    /* op_result[APPEND] = T_SEQUENCE */
    Base[35] = 3;

    /* op_result[RHS_SLICE] = T_SEQUENCE */
    Base[46] = 3;

    /* op_result[CONCAT] = T_SEQUENCE */
    Base[15] = 3;

    /* op_result[CONCAT_N] = T_SEQUENCE */
    Base[159] = 3;

    /* op_result[PREPEND] = T_SEQUENCE */
    Base[57] = 3;

    /* op_result[COMMAND_LINE] = T_SEQUENCE */
    Base[100] = 3;

    /* op_result[SPRINTF] = T_SEQUENCE */
    Base[53] = 3;

    /* op_result[ROUTINE_ID] = T_INTEGER */
    Base[136] = 1;

    /* op_result[GETC] = T_INTEGER */
    Base[33] = 1;

    /* op_result[OPEN] = T_INTEGER */
    Base[37] = 1;

    /* op_result[LENGTH] = T_INTEGER   -- assume less than a billion */
    Base[42] = 1;

    /* op_result[PLENGTH] = T_INTEGER  -- "" */
    Base[162] = 1;

    /* op_result[IS_AN_OBJECT] = T_INTEGER */
    Base[40] = 1;

    /* op_result[IS_AN_ATOM] = T_INTEGER */
    Base[67] = 1;

    /* op_result[IS_A_SEQUENCE] = T_INTEGER */
    Base[68] = 1;

    /* op_result[COMPARE] = T_INTEGER */
    Base[76] = 1;

    /* op_result[EQUAL] = T_INTEGER */
    Base[155] = 1;

    /* op_result[FIND] = T_INTEGER */
    Base[77] = 1;

    /* op_result[MATCH]  = T_INTEGER */
    Base[78] = 1;

    /* op_result[GET_KEY] = T_INTEGER */
    Base[79] = 1;

    /* op_result[IS_AN_INTEGER] = T_INTEGER */
    Base[94] = 1;

    /* op_result[ASSIGN_I] = T_INTEGER */
    Base[113] = 1;

    /* op_result[RHS_SUBS_I] = T_INTEGER */
    Base[114] = 1;

    /* op_result[PLUS_I] = T_INTEGER */
    Base[115] = 1;

    /* op_result[MINUS_I] = T_INTEGER */
    Base[116] = 1;

    /* op_result[PLUS1_I] = T_INTEGER */
    Base[117] = 1;

    /* op_result[SYSTEM_EXEC] = T_INTEGER */
    Base[156] = 1;

    /* op_result[TIME] = T_ATOM */
    Base[70] = 4;

    /* op_result[TASK_STATUS] = T_INTEGER */
    Base[175] = 1;

    /* op_result[TASK_SELF] = T_ATOM */
    Base[172] = 4;

    /* op_result[TASK_CREATE] = T_ATOM */
    Base[169] = 4;

    /* op_result[TASK_LIST] = T_SEQUENCE */
    Base[174] = 3;

    /* op_result[PLATFORM] = T_INTEGER */
    Base[157] = 1;

    /* Initialize the error stack. */
    ebegin();

    _18main();
    Cleanup(0);
}

int _18ProcessOptions()
{
    int src_file, src_name;
    int _4522;
    int _1, _2;

    if (_4Argc >= 3) {
        _2 = (int)SEQ_PTR(_4Argv);
        src_name = (int)*(((s1_ptr)_2)->base + 3);
        Ref(src_name);
    }
    else {
        _6screen_output(1, NewString("Gyroe interpreter version 1.0.0 pre-alpha.\n"));
        _6screen_output(1, NewString("Copyright (c) Jesse Adkins.\n"));
        _6screen_output(1, NewString("Made from the Euphoria interpreter by RDS.\n"));
        _6screen_output(1, NewString("File to interpret : "));
        src_name = EGets(0); /* STDIN */
        _6screen_output(1, NewString("\n"));

        /* Remove the extra newline from gets() */
        rhs_slice_target = (object_ptr)&src_name;
        RHS_Slice((s1_ptr)src_name, 1, SEQ_PTR(src_name)->length - 1);

        if (SEQ_PTR(src_name)->length == 0) {
            _6Cleanup(1);
        }

        _4Argc = 2;

        /* Argv = {Argv[1], src_name} */
        DeRef(_4522);
        _2 = (int)SEQ_PTR(_4Argv);
        _4522 = (int)*(((s1_ptr)_2)->base + 1);
        Ref(_4522);
        DeRefDS(_4Argv);
        _1 = NewS1(2);
        _2 = (int)((s1_ptr)_1)->base;
        ((int *)_2)[1] = _4522;
        Ref(_4522);
        ((int *)_2)[2] = src_name;
        RefDS(src_name);
        _4Argv = MAKE_SEQ(_1);

        RefDS(src_name);
        DeRef(_4file_name_entered);
        _4file_name_entered = src_name;
    }

    RefDS(src_name);
    Append(&_4file_name, _4file_name, src_name);

    /* src_file = e_path_open(src_name, "r") */
    RefDS(src_name);
    RefDS(_1663);
    src_file = _20e_path_open(src_name, _1663);

    DeRef(src_name);
    return src_file;
}

int _18main()
{
    int argc, argv;
    int _4586;
    int _1, _2;

    argv = Command_Line();
    argc = SEQ_PTR(argv)->length;

    RefDS(argv);
    DeRef(_4Argv);
    _4Argv = argv;

    _4Argc = argc;

    DeRefi(_4eudir);

    _4eudir = EGetEnv(NewString("EUDIR"));

    if (IS_ATOM(_4eudir)) {
        if (_4ELINUX) {
            /* eudir = getenv("HOME") */
            DeRefi(_4eudir);
            _4eudir = EGetEnv(_4592);

            if (IS_ATOM(_4eudir)) {
                /* eudir = "euphoria" */
                RefDS(_4595);
                DeRefi(_4eudir);
                _4eudir = _4595;
            }
            else {
                /* eudir = eudir & "/euphoria" */
                Concat((object_ptr)&_4eudir, _4eudir, (s1_ptr)_4596);
            }
        }
        else {
            /* eudir = "\\EUPHORIA" */
            RefDS(_4598);
            DeRefi(_4eudir);
            _4eudir = _4598;
        }
    }

    /* TempErrName = "ex.err" */
    RefDS(_4602);
    DeRefi(_6TempErrName);
    _6TempErrName = _4602;

    _11src_file = _18ProcessOptions();

    if (_11src_file == -1) {
        /* Can't open %s\n */
        err_add(NewString("Can't open "));
        err_add(SEQ_PTR(_4file_name)->base[1]);
        err_add(NewString("\n"));

        /* Output to screen and cleanup. Too early for set_err_stack. */
        _6screen_output(2, error_stack);
        _6Cleanup(1);
    }

    /* main_path = full_path(file_name[1]) */
    DeRef(_4586);
    _2 = (int)SEQ_PTR(_4file_name);
    _4586 = (int)*(((s1_ptr)_2)->base + 1);
    RefDS(_4586);
    RefDS(_4586);
    DeRef(_11main_path);
    _11main_path = _11get_file_path(_4586);

    _15InitGlobals();
    _10InitSymTab();
    _14InitEmit();
    _15InitParser();
    _11InitLex();
    _11read_line();
    _15parser();

    _17BackEnd(); /* Call the backend (be_*.c files) */

    _6Cleanup(0);

    DeRef(argv);
    DeRef(_4586);
    return 0;
}

